\(\int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx\) [45]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 83 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {a^4 \cot (c+d x)}{d}+\frac {4 a^3 b \log (\tan (c+d x))}{d}+\frac {6 a^2 b^2 \tan (c+d x)}{d}+\frac {2 a b^3 \tan ^2(c+d x)}{d}+\frac {b^4 \tan ^3(c+d x)}{3 d} \]

[Out]

-a^4*cot(d*x+c)/d+4*a^3*b*ln(tan(d*x+c))/d+6*a^2*b^2*tan(d*x+c)/d+2*a*b^3*tan(d*x+c)^2/d+1/3*b^4*tan(d*x+c)^3/
d

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3597, 45} \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {a^4 \cot (c+d x)}{d}+\frac {4 a^3 b \log (\tan (c+d x))}{d}+\frac {6 a^2 b^2 \tan (c+d x)}{d}+\frac {2 a b^3 \tan ^2(c+d x)}{d}+\frac {b^4 \tan ^3(c+d x)}{3 d} \]

[In]

Int[Csc[c + d*x]^2*(a + b*Tan[c + d*x])^4,x]

[Out]

-((a^4*Cot[c + d*x])/d) + (4*a^3*b*Log[Tan[c + d*x]])/d + (6*a^2*b^2*Tan[c + d*x])/d + (2*a*b^3*Tan[c + d*x]^2
)/d + (b^4*Tan[c + d*x]^3)/(3*d)

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3597

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[b/f, Subst[Int
[x^m*((a + x)^n/(b^2 + x^2)^(m/2 + 1)), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[m/
2]

Rubi steps \begin{align*} \text {integral}& = \frac {b \text {Subst}\left (\int \frac {(a+x)^4}{x^2} \, dx,x,b \tan (c+d x)\right )}{d} \\ & = \frac {b \text {Subst}\left (\int \left (6 a^2+\frac {a^4}{x^2}+\frac {4 a^3}{x}+4 a x+x^2\right ) \, dx,x,b \tan (c+d x)\right )}{d} \\ & = -\frac {a^4 \cot (c+d x)}{d}+\frac {4 a^3 b \log (\tan (c+d x))}{d}+\frac {6 a^2 b^2 \tan (c+d x)}{d}+\frac {2 a b^3 \tan ^2(c+d x)}{d}+\frac {b^4 \tan ^3(c+d x)}{3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 3.30 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.95 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {\csc (c+d x) \sec ^3(c+d x) \left (4 \left (3 a^4+b^4\right ) \cos (2 (c+d x))+\left (3 a^4+18 a^2 b^2-b^4\right ) \cos (4 (c+d x))+3 \left (3 a^4-6 a^2 b^2-b^4+8 a b \left (-b^2+a^2 \log (\cos (c+d x))-a^2 \log (\sin (c+d x))\right ) \sin (2 (c+d x))+4 a^3 b (\log (\cos (c+d x))-\log (\sin (c+d x))) \sin (4 (c+d x))\right )\right )}{24 d} \]

[In]

Integrate[Csc[c + d*x]^2*(a + b*Tan[c + d*x])^4,x]

[Out]

-1/24*(Csc[c + d*x]*Sec[c + d*x]^3*(4*(3*a^4 + b^4)*Cos[2*(c + d*x)] + (3*a^4 + 18*a^2*b^2 - b^4)*Cos[4*(c + d
*x)] + 3*(3*a^4 - 6*a^2*b^2 - b^4 + 8*a*b*(-b^2 + a^2*Log[Cos[c + d*x]] - a^2*Log[Sin[c + d*x]])*Sin[2*(c + d*
x)] + 4*a^3*b*(Log[Cos[c + d*x]] - Log[Sin[c + d*x]])*Sin[4*(c + d*x)])))/d

Maple [A] (verified)

Time = 3.40 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.95

method result size
derivativedivides \(\frac {\frac {b^{4} \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+\frac {2 a \,b^{3}}{\cos \left (d x +c \right )^{2}}+6 a^{2} b^{2} \tan \left (d x +c \right )+4 a^{3} b \ln \left (\tan \left (d x +c \right )\right )-a^{4} \cot \left (d x +c \right )}{d}\) \(79\)
default \(\frac {\frac {b^{4} \left (\sin ^{3}\left (d x +c \right )\right )}{3 \cos \left (d x +c \right )^{3}}+\frac {2 a \,b^{3}}{\cos \left (d x +c \right )^{2}}+6 a^{2} b^{2} \tan \left (d x +c \right )+4 a^{3} b \ln \left (\tan \left (d x +c \right )\right )-a^{4} \cot \left (d x +c \right )}{d}\) \(79\)
risch \(-\frac {2 i \left (12 i a \,b^{3} {\mathrm e}^{6 i \left (d x +c \right )}+3 a^{4} {\mathrm e}^{6 i \left (d x +c \right )}-18 a^{2} b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+3 b^{4} {\mathrm e}^{6 i \left (d x +c \right )}+9 a^{4} {\mathrm e}^{4 i \left (d x +c \right )}-18 a^{2} b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-3 b^{4} {\mathrm e}^{4 i \left (d x +c \right )}-12 i a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}+9 a^{4} {\mathrm e}^{2 i \left (d x +c \right )}+18 a^{2} b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+b^{4} {\mathrm e}^{2 i \left (d x +c \right )}+3 a^{4}+18 a^{2} b^{2}-b^{4}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {4 a^{3} b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(261\)

[In]

int(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/3*b^4*sin(d*x+c)^3/cos(d*x+c)^3+2*a*b^3/cos(d*x+c)^2+6*a^2*b^2*tan(d*x+c)+4*a^3*b*ln(tan(d*x+c))-a^4*co
t(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.92 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=-\frac {6 \, a^{3} b \cos \left (d x + c\right )^{3} \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - 6 \, a^{3} b \cos \left (d x + c\right )^{3} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) - 6 \, a b^{3} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (3 \, a^{4} + 18 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{4} - b^{4} - 2 \, {\left (9 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )^{2}}{3 \, d \cos \left (d x + c\right )^{3} \sin \left (d x + c\right )} \]

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="fricas")

[Out]

-1/3*(6*a^3*b*cos(d*x + c)^3*log(cos(d*x + c)^2)*sin(d*x + c) - 6*a^3*b*cos(d*x + c)^3*log(-1/4*cos(d*x + c)^2
 + 1/4)*sin(d*x + c) - 6*a*b^3*cos(d*x + c)*sin(d*x + c) + (3*a^4 + 18*a^2*b^2 - b^4)*cos(d*x + c)^4 - b^4 - 2
*(9*a^2*b^2 - b^4)*cos(d*x + c)^2)/(d*cos(d*x + c)^3*sin(d*x + c))

Sympy [F]

\[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right )^{4} \csc ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(csc(d*x+c)**2*(a+b*tan(d*x+c))**4,x)

[Out]

Integral((a + b*tan(c + d*x))**4*csc(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.87 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 12 \, a^{3} b \log \left (\tan \left (d x + c\right )\right ) + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - \frac {3 \, a^{4}}{\tan \left (d x + c\right )}}{3 \, d} \]

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="maxima")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 12*a^3*b*log(tan(d*x + c)) + 18*a^2*b^2*tan(d*x + c) - 3*a^
4/tan(d*x + c))/d

Giac [A] (verification not implemented)

none

Time = 1.12 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.04 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {b^{4} \tan \left (d x + c\right )^{3} + 6 \, a b^{3} \tan \left (d x + c\right )^{2} + 12 \, a^{3} b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) + 18 \, a^{2} b^{2} \tan \left (d x + c\right ) - \frac {3 \, {\left (4 \, a^{3} b \tan \left (d x + c\right ) + a^{4}\right )}}{\tan \left (d x + c\right )}}{3 \, d} \]

[In]

integrate(csc(d*x+c)^2*(a+b*tan(d*x+c))^4,x, algorithm="giac")

[Out]

1/3*(b^4*tan(d*x + c)^3 + 6*a*b^3*tan(d*x + c)^2 + 12*a^3*b*log(abs(tan(d*x + c))) + 18*a^2*b^2*tan(d*x + c) -
 3*(4*a^3*b*tan(d*x + c) + a^4)/tan(d*x + c))/d

Mupad [B] (verification not implemented)

Time = 4.12 (sec) , antiderivative size = 81, normalized size of antiderivative = 0.98 \[ \int \csc ^2(c+d x) (a+b \tan (c+d x))^4 \, dx=\frac {b^4\,{\mathrm {tan}\left (c+d\,x\right )}^3}{3\,d}-\frac {a^4\,\mathrm {cot}\left (c+d\,x\right )}{d}+\frac {6\,a^2\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{d}+\frac {2\,a\,b^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{d}+\frac {4\,a^3\,b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d} \]

[In]

int((a + b*tan(c + d*x))^4/sin(c + d*x)^2,x)

[Out]

(b^4*tan(c + d*x)^3)/(3*d) - (a^4*cot(c + d*x))/d + (6*a^2*b^2*tan(c + d*x))/d + (2*a*b^3*tan(c + d*x)^2)/d +
(4*a^3*b*log(tan(c + d*x)))/d